class OneMorePlayGame extends eui.Component implements  eui.UIComponent {
	public constructor() {
		super();
		this.skinName = "gameSkin";
	}

	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}

	private xuehua1;
	private xuehua2;
	private wazi01;
	private lingdang01;
	private shou01;
	private jiangpin01;
	private youxiguize;
	private youxikaishi;

	private channel;

	private laoren;
	private guize;
	

	private kaishiyouxi;

	private gameRule;
	private operatingInstruction;
	protected childrenCreated():void
	{
		var music = RES.getRes("Aaron Angello - Our Canon In D_mp3");
		this.channel=music.play();
		var disp = false;
		super.childrenCreated();
		this.playAnimation(this.xuehua1,true);
		this.playAnimation(this.xuehua2,true);
		this.playAnimation(this.wazi01,true);
		this.playAnimation(this.lingdang01,true);
		this.playAnimation(this.shou01,true);
		this.playAnimation(this.jiangpin01,true);
		this.youxiguize.touchEnabled = true;
		this.youxiguize.addEventListener(egret.TouchEvent.TOUCH_END,function(){
			if(!disp){
				disp = true;
				egret.Tween.get(this.guize).to({x:16},500);
				egret.Tween.get(this.laoren).to({x:512},500);
			}else{
				disp = false;
				egret.Tween.get(this.guize).to({x:-736},500);
				egret.Tween.get(this.laoren).to({x:750},500);
			}
		}.bind(this),this);
		this.youxikaishi.addEventListener(egret.TouchEvent.TOUCH_END,function(){
			egret.Tween.get(this.operatingInstruction).to({y:0},500);
		}.bind(this),this);
		this.kaishiyouxi.addEventListener(egret.TouchEvent.TOUCH_END,function(){
			
			SceneManages.getInstance(this.stage).loadSence('Ready',Ready);
			this.channel.stop();
			this.channel = null;
		}.bind(this),this);
		
	}
	private playAnimation(target: egret.tween.TweenGroup, isLoop: boolean): void {
		if (isLoop) {
			for (var key in target.items) {
				target.items[key].props = { loop: true};
			}
		}
		target.play();
	}
}